/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.isn.atencionemergencia.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import com.isn.historiaclinica.entity.TipoDeDocumento;

/**
 *
 * @author pool
 */
@Entity
@Table(name = "responsable_del_paciente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ResponsableDelPaciente.findAll", query = "SELECT r FROM ResponsableDelPaciente r"),
    @NamedQuery(name = "ResponsableDelPaciente.findByCodResPac", query = "SELECT r FROM ResponsableDelPaciente r WHERE r.codResPac = :codResPac"),
    @NamedQuery(name = "ResponsableDelPaciente.findByNomRes", query = "SELECT r FROM ResponsableDelPaciente r WHERE r.nomRes = :nomRes"),
    @NamedQuery(name = "ResponsableDelPaciente.findByApePatRes", query = "SELECT r FROM ResponsableDelPaciente r WHERE r.apePatRes = :apePatRes"),
    @NamedQuery(name = "ResponsableDelPaciente.findByApeMatRes", query = "SELECT r FROM ResponsableDelPaciente r WHERE r.apeMatRes = :apeMatRes"),
    @NamedQuery(name = "ResponsableDelPaciente.findByNumDoc", query = "SELECT r FROM ResponsableDelPaciente r WHERE r.numDoc = :numDoc")})
public class ResponsableDelPaciente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Cod_Res_Pac", columnDefinition="CHAR(5) unsigned")
    private String codResPac;
    @Column(name = "Nom_Res")
    private String nomRes;
    @Column(name = "Ape_Pat_Res")
    private String apePatRes;
    @Column(name = "Ape_Mat_Res")
    private String apeMatRes;
    @Column(name = "Num_Doc")
    private String numDoc;
    @JoinColumn(name = "Num_Oae", referencedColumnName = "Num_Oae")
    @ManyToOne(optional = false)
    private OrdenDeAtencionDeEmergencia numOae;
    @JoinColumn(name = "Cod_Tipdocu", referencedColumnName = "Cod_Tipdocu")
    @ManyToOne(optional = false)
    private TipoDeDocumento codTipdocu;

    public ResponsableDelPaciente() {
    }

    public ResponsableDelPaciente(String codResPac) {
        this.codResPac = codResPac;
    }

    public String getCodResPac() {
        return codResPac;
    }

    public void setCodResPac(String codResPac) {
        this.codResPac = codResPac;
    }

    public String getNomRes() {
        return nomRes;
    }

    public void setNomRes(String nomRes) {
        this.nomRes = nomRes;
    }

    public String getApePatRes() {
        return apePatRes;
    }

    public void setApePatRes(String apePatRes) {
        this.apePatRes = apePatRes;
    }

    public String getApeMatRes() {
        return apeMatRes;
    }

    public void setApeMatRes(String apeMatRes) {
        this.apeMatRes = apeMatRes;
    }

    public String getNumDoc() {
        return numDoc;
    }

    public void setNumDoc(String numDoc) {
        this.numDoc = numDoc;
    }

    public OrdenDeAtencionDeEmergencia getNumOae() {
        return numOae;
    }

    public void setNumOae(OrdenDeAtencionDeEmergencia numOae) {
        this.numOae = numOae;
    }

    public TipoDeDocumento getCodTipdocu() {
        return codTipdocu;
    }

    public void setCodTipdocu(TipoDeDocumento codTipdocu) {
        this.codTipdocu = codTipdocu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codResPac != null ? codResPac.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ResponsableDelPaciente)) {
            return false;
        }
        ResponsableDelPaciente other = (ResponsableDelPaciente) object;
        if ((this.codResPac == null && other.codResPac != null) || (this.codResPac != null && !this.codResPac.equals(other.codResPac))) {
            return false;
        }
        return true;
    }

 }
